package 并查集;

public class QuickUnionRankPC extends QuickUnionRank{

	public QuickUnionRankPC(int capacity) {
		super(capacity);
	}
	
	/**
	 * 路径压缩
	 */
	@Override
	public int find(int v) {
		rangeCheck(v);
		if (v != parents[v]) {
			parents[v] = find(parents[v]);
		}
		return parents[v];
	}
	
}
